package src.main.java.com.health.coupon;

import org.apache.kafka.common.errors.WakeupException;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import src.main.java.com.health.coupon.security.AuthCheckInterceptor;

import javax.annotation.Resource;



@SpringBootApplication
public class MerchantsApplication extends WebMvcConfigurationSupport {
    @Resource
    private AuthCheckInterceptor authCheckInterceptor;
    public static void main(String[] args) {
        SpringApplication.run(MerchantsApplication.class, args);
    }

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authCheckInterceptor)
                .addPathPatterns("/merchants/**");
        super.addInterceptors(registry);
    }
}
